compan — Companion matrix
compan
returns the companion matrix of the argument matrix.
If the argument is an (n+1)-vector, the companion matrix is nxn. If
the argument is a scalar, say s, then compan(s)
is the
sxs matrix formed by taking the companion of
[1, 2,…, s + 1]. If
the argument is a matrix, but is not a vector, an internal conversion
to vector format is done.
This is not an built-in function. This function
is normally loaded on start-up from the compan.r
file in the
standard rlib
directory. Use of the -r
option, incorrectly
setting the RLAB_LIB_DIR
environmental variable, or modifying
compan.r
may make this function unavailable.
Subsections